package com.nbsaas.boot.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 注册中心配置
 * 
 * @author nbsaas
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "registry")
public class RegistryConfig {

    /**
     * 是否自动注册
     */
    private boolean autoRegister = false;

    /**
     * 默认注册中心类型
     */
    private String type = "nacos";

    /**
     * Nacos配置
     */
    private NacosConfig nacos = new NacosConfig();

    /**
     * Polaris配置
     */
    private PolarisConfig polaris = new PolarisConfig();

    @Data
    public static class NacosConfig {
        /**
         * Nacos服务器地址
         */
        private String serverAddr = "127.0.0.1:8848";

        /**
         * 命名空间
         */
        private String namespace = "public";

        /**
         * 分组
         */
        private String group = "DEFAULT_GROUP";
    }

    @Data
    public static class PolarisConfig {
        /**
         * Polaris服务器地址
         */
        private String serverAddr = "127.0.0.1:8091";
    }
} 